Attack of Opportunity

Combat Rule

If an enemy moves out of a square adjacent to you or performs an action that forces him to let down his guard, you can make a single, immediate attack against that enemy (even if you've already acted during the round). This is called an attack of opportunity.

You can only make attacks of opportunity with melee weapons, natural weapons, pistols, carbines, and any weapon with a folded stock. You may also make attacks of opportunity while unarmed if you have the Martial Arts I feat.

Provoking an Attack of Opportunity

Two actions can provoke attacks of opportunity:

Most characters threaten the squares adjacent to them; larger characters threaten all squares within their reach (see Reach). A creature only threatens an area if it is armed with a natural weapon, a melee weapon, a pistol, a carbine, or any weapon with a folded stock.

Moving Out of a Threatened Square
When you move out of a threatened square, you generally provoke an attack of opportunity. You do not provoke an attack of opportunity if you use the withdraw action or if you successfully tumble (see Acrobatics skill).

Performing an Action that Distracts You
Some actions, when performed in a threatened area, provoke attacks of opportunity because they make you divert your attention from the fight at hand. The following actions provoke attacks of opportunity

Making an Attack of Opportunity

An attack of opportunity is a single free attack, and you can only make one attack of opportunity per round. You don't have to make an attack of opportunity if you don't want to. An attack of opportunity is always made at your full attack bonus, minus any situational penalties you suffer.

You can't make an attack of opportunity if you're flat-footed.

Combat Reflexes
If you have the Combat Reflexes feat, you can make more than one attack of opportunity during a round, and you may make an attack of opportunity while flat-footed. However, you may only make one attack of opportunity per provoking action. (Moving any number of squares is treated as a single provoking action.)